package com.dg11185.nearshop.net.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class Address implements Parcelable{

    public String name = "";
    public String phone = "";
    public String province = "";

    public String city = "";
    public String address = "";
    public String postCode = "";

    public Address() {

    }

    public Address(Parcel in) {
        String[] data = new String[6];
        in.readStringArray(data);
        this.name = data[0];
        this.phone = data[1];
        this.province = data[2];
        this.city = data[3];
        this.address = data[4];
        this.postCode = data[5];
    }

    public static final Parcelable.Creator<Address> CREATOR = new Creator<Address>() {

        @Override
        public Address createFromParcel(Parcel source) {
            return new Address(source);
        }

        @Override
        public Address[] newArray(int size) {
            return new Address[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeStringArray(new String[] {
                this.name, this.phone,this.province,this.city,this.address,this.postCode
        });
    }
}
